package cn.iocoder.yudao.module.infra.api.file;


import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

/**
 * 文件 API 实现类
 *
 * @author 芋道源码
 */
@Service
@Validated
public class FileApiImpl implements FileApi {

    @Resource
    private FileService fileService;

    @Override
    public String createFile(byte[] content, String name, String directory, String type) {
        return fileService.createFile(content, name, directory, type);
    }

    @Override
    public FileDO createFile02(byte[] content, String name, String directory, String type) {
        return  fileService.createFile02(content, name, directory, type);
    }

    @Override
    public FileDO createFile03(String name, String path, byte[] content) {
        return fileService.createFile03( name, path, content);
    }


    @Override
    public FileDO getFileByPath(String path) {
        return  fileService.getFileByPath(path);
    }

    @Override
    public void deleteFile(Long id) throws Exception {
        fileService.deleteFile(id);
    }

    @Override
    public String presignGetUrl(String url, Integer expirationSeconds) {
        return fileService.presignGetUrl(url, expirationSeconds);
    }

}
